<template>
    <div class="header">
        <el-row :gutter="10">
            <!-- logo area -->
            <el-col :xs="12" :sm="12" :md="8">
                <div class="logo">
                    <span class="log_preffix">NanHuan</span>
                    <span class="logo_suffix">Community</span>
                </div>
            </el-col>
            <!-- header right area -->
            <el-col :xs="8" :sm="8" :md="{span:2,offset:10}">
                <div class="header-right">
                    <el-col :span="10">
                        <el-dropdown menu-align="start">
                            <span class="el-dropdown-link">
                                <el-badge :value="5" class="item">
                                    <i class="el-icon-message"></i>
                                </el-badge>
                            </span>
                            <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item>
                                    <span class="pop-title">You have new message!</span>
                                </el-dropdown-item>
                                <el-dropdown-item v-for="dialog in dialogs" :key="dialog.time" divided>
                                    <div class="pop-div">
                                        <span class="pop-content">
                                            {{dialog.content}}
                                        </span>
                                        <span class="pop-time">
                                            {{dialog.time}}分钟前
                                        </span>
                                    </div>
                                </el-dropdown-item>
                            </el-dropdown-menu>
                        </el-dropdown>
                    </el-col>
                    <el-col :span="8">
                        <el-dropdown menu-align="start">
                            <span>
                                <el-badge :value="3" class="item">
                                    <i class="el-icon-date"></i>
                                </el-badge>
                            </span>
                            <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item>
                                    <span class="pop-title">You have new arro!</span>
                                </el-dropdown-item>
                                <el-dropdown-item v-for="task in tasks" :key="task.id" divided>
                                    <div class="task-div">
                                        <span class="task-span task-tag">
                                            <el-tag type="danger" v-if="task.rank==1">紧急</el-tag>
                                            <el-tag type="warning" v-if="task.rank==2">重要</el-tag>
                                            <el-tag type="success" v-if="task.rank==3">正常</el-tag>
                                        </span>
                                        <span class="task-span task-content">
                                            {{task.content}}<br/>
                                            <span class="task-time">截止：{{task.overTime}}</span>
                                        </span>
                                        <span class="task-span task-btn">
                                            <el-button type="primary" size="mini">完成</el-button>
                                        </span>
                                    </div>
                                </el-dropdown-item>
                            </el-dropdown-menu>
                        </el-dropdown>
                    </el-col>
                </div>
            </el-col>
            <el-col :xs="8" :sm="8" :md="2">
                <div class="user-header">
                    <el-dropdown trigger="click" menu-align="start">
                        <div class="user-header-img"><img src="../../../static/images/b_header.jpg" /></div>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item>
                                <div class="setting-div">
                                    <span class="setting-icon">
                                        <i class="el-icon-service"></i>
                                    </span>
                                    <span class="setting-string"> Profile 个人</span>
                                </div>
                            </el-dropdown-item>
                            <el-dropdown-item divided>
                                <div class="setting-div">
                                    <span class="setting-icon">
                                        <i class="el-icon-setting"></i>
                                    </span>
                                    <span class="setting-string"> Settings 设置</span>
                                </div>
                            </el-dropdown-item>
                            <el-dropdown-item divided>
                                <div class="setting-div">
                                    <span class="setting-icon">
                                        <i class="el-icon-delete"></i>
                                    </span>
                                    <span class="setting-string"> Sign out 退出</span>
                                </div>

                            </el-dropdown-item>

                        </el-dropdown-menu>
                    </el-dropdown>
                </div>
            </el-col>
        </el-row>
    </div>
</template>
<script>
export default {
  name: "xinlin",
  data() {
    return {
      dialogs: [
        {
          content: "王大妈腰骨疼，快快去看看",
          time: "3"
        },
        {
          content: "刘婶张了一颗痔疮应该怎么治愈？。",
          time: "15"
        },
        {
          content: "下午三点钟有一台手术！",
          time: "18"
        },
        {
          content: "下午3点开需求会议，准时参加。",
          time: "24"
        },
        {
          content: "主任来检查了，赶紧收拾收拾桌子。",
          time: "45"
        }
      ],
      tasks: [
        {
          id: 1,
          rank: 1,
          content: "完成JSPangAdmin头部头部组件的编写。",
          overTime: "2018/8/9"
        },
        {
          id: 2,
          rank: 2,
          content: "完成GitHub仓库的初始化工作。",
          overTime: "2018/10/15"
        },
        {
          id: 3,
          rank: 3,
          content: "在阿里云进行网站备案，完成后通知组长。",
          overTime: "2018/12/20"
        }
      ]
    };
  }
};
</script>
<style lang="less" scoped>
.header {
  position: fixed;
  box-sizing: border-box;
  width: 100%;
  height: 66px;
  font-size: 14px;
  line-height: 66px;
  box-shadow: 2px 0 3px rgba(0, 0, 0, 0.5);
  z-index: 3;
  padding: 0 32px 0 40px;
  overflow: hidden;
//   background-color: #324157;
  background-color: #009983;
  .logo {
    float: left;
    cursor: pointer;
    font-size: 22px;
    .log_preffix {
      color: #324157;
    }
    .logo_suffix {
      color: #fff;
    }
  }
}
.header-right {
  color: white;
  span {
    display: inline-block;
    font-size: 22px;
    margin-left: 14px;
    line-height: 1px;
    height: 18px;
    cursor: pointer;
    color: white;
  }
}
.pop-div {
  font-size: 10px;
}
.task-div {
  clear: both;
  height: 55px;
  .task-span {
    display: block;
    float: left;
    font-size: 12px;
  }
  .task-content {
    width: 160px;
    line-height: 16px;
    margin-left: 10px;
    padding: 5px;
  }
  .task-time {
    clear: both;
    float: right;
    color: #ccc;
  }
}
.user-header {
  margin-top: 5px;
  .user-header-img {
    border-radius: 50%;
    overflow: hidden;
    width: 50px;
    height: 50px;
    img {
      width: 100%;
      height: 100%;
    }
  }
}

.setting-div {
  height: 30px;
  line-height: 30px;
  clear: both; 
  span {
    display: block;
    float: left;
    font-size: 12px;
  }
  .setting-icon {
  padding-right: 3px;
}
}

</style>

